import request from "../../axios";
import beSampleUnitsActivities from "../../views/TestManagement/BeSampleUnitsActivities";

/**
 * 获取所有的活动记录
 * @param tblActivities
 * @returns {*}
 */
export function getAllActivitiesByPage(tblActivities) {
  // console.log(pageSize)
  return request({
    url:'/gmu/tbl-activities/activityRecordList',
    method:'get',
    params: tblActivities
  })
}

/**
 * 删除活动记录
 * @param activitiesIds
 * @returns {*}
 */
export function deleteRecord(activitiesIds) {
  return request({
    url:'/gmu/tbl-activities/deleteRecord/'+activitiesIds,
    method:'delete'
  })
}

/**
 * 导出核酸检测活动记录
 * @returns {*}
 */
export function exportRecord(activities) {
  return request({
    url:'/gmu/tbl-activities/exportRecord',
    method:'get',
    params:activities,
    responseType:'blob'
  })
}

/**
 * 根据活动id查询被采样单位活动记录
 * @param beSampleUnitsActivities
 * @returns {*}
 */
export function getBeSampleUnitsActivitiesByActivitiesId(beSampleUnitsActivities) {
  return request({
    url:'/gmu/be-sample-units-activities/getBeSampleUnitsActivitiesByActivitiesId',
    method:'get',
    params:beSampleUnitsActivities
  })
}

/**
 * 导出被采样单位活动记录数据
 * @returns {*}
 * @param beSample
 */
export function exportBeSampleUnitsActivitiesRecord(beSample) {
  return request({
    url:'/gmu/be-sample-units-activities/exportRecord',
    method:'get',
    params:beSample,
    responseType:'blob'
  })
}

/**
 * 批量删除被采样单位活动记录
 * @param beSampleIds
 * @returns {*}
 */
export function deleteBeSampleUnitsActivities(beSampleIds) {
  return request({
    url:'deleteActivitiesByIds/'+beSampleIds,
    method:'delete'
  })
}

/**
 * 获取某个核算检测活动信息
 * @param activitiesId
 * @returns {*}
 */
export function getActivity(activitiesId) {
  return request({
    url:'/gmu/tbl-activities/'+activitiesId,
    method:'get'
  })
}

/**
 * 获取所有的预约记录
 * @param tblOrder
 * @returns {*}
 */
export function getAllReservationByPage(tblOrder) {
  return request({
    url:'/gmu/tbl-order/reservationRecordList',
    method:'get',
    params: tblOrder
  })
}

/**
 * 删除已经完成或失败的预约记录
 * @param ids
 * @returns {*}
 */
export function deleteReservationRecord(ids) {
  return request({
    url:'/gmu/tbl-order/deleteReservationRecord/'+ids,
    method:'delete'
  })
}

/**
 * 删除待检测的预约记录
 * @param id
 * @returns {*}
 */
export function deleteReservation(id) {
  return request({
    url:'/gmu/tbl-order/deleteReservation'+id,
    method:'delete'
  })
}

/**
 * 导出核酸预约记录
 * @returns {*}
 */
export function exportReservationRecord(tblOrder) {
  return request({
    url:'/gmu/tbl-order/exportRecord',
    method:'get',
    params:tblOrder,
    responseType:'blob'
  })
}

/**
 * 获取所有的采样记录
 * @param tblSample
 * @returns {*}
 */
export function getAllSampleByPage(tblSample) {
  return request({
    url:'/gmu/tbl-sample/sampleRecordList',
    method:'get',
    params: tblSample
  })
}

/**
 * 删除采样记录
 * @param sampleRecordIds
 * @returns {*}
 */
export function deleteSampleRecord(sampleRecordIds) {
  return request({
    url:'/gmu/tbl-sample/deleteSampleRecord'+sampleRecordIds,
    method:'delete'
  })
}

/**
 * 导出采样记录
 * @returns {*}
 */
export function exportSampleRecord(tblSample) {
  return request({
    url:'/gmu/tbl-sample/exportRecord',
    method:'get',
    params:tblSample,
    responseType:'blob'
  })
}
